package com.manzuo.examples.showcase.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.manzuo.examples.showcase.dao.UserDao;
import com.manzuo.examples.showcase.model.User;

@Controller
public class UserController {
	
	@Autowired
	private UserDao userDao;
	
	@RequestMapping("/users/saveUser")
	public String saveUser() {
		
		User user = new User();
		user.setName(new Long(System.currentTimeMillis()).toString());
		user.setPassword("p:"+user.getName());
		
		userDao.saveUser(user);
		
		return "success";
	}
	
}
